<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <script language="javascript" type="text/javascript" src="JS/DatePicker/WdatePicker.js"></script>
  <link href="JS/DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
  <style type="text/css">
    div{
      width:100%;
    }
  </style>
  <!--[if lt IE 9]>
  <script type="text/javascript" src="JS/html5.js"></script>
  <script type="text/javascript" src="JS/respond.min.js"></script>
  <script type="text/javascript" src="JS/PIE_IE678.js"></script>
  <![endif]-->
  <link type="text/css" rel="stylesheet" href="CSS/H-ui.css"/>
  <link type="text/css" rel="stylesheet" href="CSS/H-ui.admin.css"/>
  <link type="text/css" rel="stylesheet" href="FONT/font-awesome.min.css"/>
  <!--[if IE 7]>
  <link href="FONT/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
  <![endif]-->
  <title>修改内容</title>
</head>
<body>
<div class="pd-20">
  <div class="Huiform">
    <form action="<?php echo U('Admin/User/save');?>" method="post" name="myform" id="editform" enctype="multipart/form-data">
      <input type="hidden" value="<?php echo ($admin_info['id']); ?>" name='id'>
      <table class="table table-bg">
        <tbody>
        <tr>
          <th width="100" class="text-r"><span class="c-red">*</span> 用户名：</th>
          <td><input type="text" style="width:200px" class="input-text" value="<?php echo ($admin_info['name']); ?>" placeholder="" id="user-name" name="username" datatype="*2-25" nullmsg="用户名不能为空" readonly="readonly"></td>
        </tr>
        <tr>
          <th class="text-r">原始密码：</th>
          <td>  <input type="password" class="input-text" name="old_admin_password" placeholder="请输入原始密码" datatype="*3-16" nullmsg="请输入原始密码！" errormsg="密码范围在3~16位之间！"/>
            <span class="Validform_checktip"></span></td>
        </tr>
        <tr>
          <th class="text-r">新密码：</th>
          <td> <input type="password" class="input-text" name="admin_password" placeholder="密码为3-16位字符串" datatype="*3-16"  nullmsg="请设置密码！" errormsg="密码范围在3~16位之间！"/>
            <span class="Validform_checktip"></span></td>
        </tr>
        <tr>
          <th class="text-r">确认密码：</th>
          <td> <input type="password" name="re_admin_repassword" class="input-text" placeholder="再次输入密码" datatype="*" ignore="ignore" recheck="admin_password" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！" />
            <span class="Validform_checktip"></span></td>
        </tr>
        <tr>
          <th></th>
          <td><button class="btn btn-success radius" type="submit"><i class="icon-ok"></i> 确定</button>&nbsp;&nbsp;<a href="<?php echo U('Admin/User/update');?>" class="btn btn-success radius"><i class="icon-ok"></i> 返回</a></td>
        </tr>
        </tbody>
      </table>
    </form>
  </div>
</div>
<script type="text/javascript" src="JS/jquery.min.js"></script>
<script type="text/javascript" src="JS/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="JS/H-ui.js"></script>
<script type="text/javascript" src="JS/H-ui.admin.js"></script>
<script type="text/javascript">
  $(".Huiform").Validform();

          $(function(){
            <!-- 提交表单合法性验证 -->
            $("#editform").Validform({
              tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                  var objtip=o.obj.siblings(".Validform_checktip");
                  cssctl(objtip,o.type);
                  objtip.text(msg);
                }
              },
              ajaxPost:true,
              callback:function(data){
                if(data.status=="ok"){
                  alert('密码修改成功，请退出重新登录！');
                  top.location.href = "<?php echo U('Admin/Login/logout');?>";
                }else{
                  alert(data.info);
                }
              }
            });

          });
</script>

</body>
</html>